# -*- coding: utf-8 -*-
"""
Created on Tue Sep 24 22:48:24 2019

@author: XCL01
"""

i=0
for x in range(1,5):
    for y in range(1,5):
        for z in range(1,5):
            if(x!=y) and (y!=z) and (z!=x):
                i += 1
                if i%2:
                    print('%s%s%s'%(x, y, z), end = '  ')
                else:
                    print('%s%s%s'%(x, y, z))
print('能组成%s个互不相同且无重复数字的三位数'%i)